//I have only made minor modifications to this class from what is created by a
//lift project create.  Mainly, removed the text field from the user and added
//a mapping to reports and users.  Also, though I am using the
//MetaMegaProtoUser, I am not using many of the niceties it provides.  So, I
//removed any fields that I am pretty sure are not relevant to my code for
//now.  Will have to check to see if I should have completely rolled my own.
package com.commutersconnect.model {

import net.liftweb._
import mapper._
import util._
import common._

/**
 * The singleton that has methods for accessing the database
 */
object User extends User with MetaMegaProtoUser[User] {
  override def dbTableName = "users" // define the DB table name
}

/**
 * An O-R mapped "User" class that includes first name, last name, password.
 * This keeps the MegaProtoUser that comes with a stock lift project, and adds
 * mappings to messages and reports that a user has made.
 */
class User
  extends MegaProtoUser[User] 
  with OneToMany[Long, User] {
  def getSingleton = User

  object organization extends MappedText(this)

  object phone extends MappedText(this)

  object messages extends MappedOneToMany(Message, Message.author)

  object reports extends MappedOneToMany(Report, Report.reporter)
}

}
